
#include "Impl_Particle.h"

_BeginNamespace(Radix)

/*
=================================================================
== Particle
=================================================================
*/
Particle::Particle()
{}

Particle::~Particle()
{}

bool Particle::alive()
{
	return mAlive;
}

void Particle::alive(bool value)
{
	mAlive = value;
}

const Vector3& Particle::position()
{
	return mPosition;
}

void Particle::position(const Vector3& pos)
{
	mPosition = pos;
}

const Vector3& Particle::velocity()
{
	return mVelocity;
}

void Particle::velocity(const Vector3& vel)
{
	mVelocity = vel;
}

const Vector3& Particle::acceler()
{
	return mAcceler;
}

void Particle::acceler(const Vector3& acc)
{
	mAcceler = acc;
}

const Color& Particle::color()
{
	return mColor;
}

void Particle::color(const Color& col)
{
	mColor = col;
}

const String& Particle::texture()
{
	return mTexture;
}

void Particle::texture(const String& tex)
{
	mTexture = tex;
}
/*
=================================================================
== ParticleSystem
=================================================================
*/
ParticleSystem::ParticleSystem()
	:mTemplates(),
	mClusters()
{}

ParticleSystem::~ParticleSystem()
{
	this->deleteClusters();
	this->deleteTemplates();
}

IParticleTemplate* ParticleSystem::createTemplate(const String& name)
{
	return mTemplates.insert<ParticleTemplate>(name);
}

IParticleTemplate* ParticleSystem::selectTemplate(const String& name)
{
	return mTemplates.select(name);
}

void ParticleSystem::deleteTemplate(const String& name)
{
	mTemplates.remove(name);
}

void ParticleSystem::deleteTemplates()
{
	mTemplates.clear();
}

IParticleCluster* ParticleSystem::createCluster(const String& name)
{
	return mClusters.insert<ParticleCluster>(name);
}

IParticleCluster* ParticleSystem::selectCluster(const String& name)
{
	return mClusters.select(name);
}

void ParticleSystem::deleteCluster(const String& name)
{
	return mClusters.remove(name);
}

void ParticleSystem::deleteClusters()
{
	return mClusters.clear();
}

_EndNamespace(Radix)
